/**
 * 
 */
package net.loyintean.pearlshell.logcenter.jms;

import javax.jms.JMSException;

import net.loyintean.pearlshell.logcenter.jms.IJmsSender;
import net.loyintean.pearlshell.logcenter.model.LogModelStub;

/**
 * @author Administrator
 * 
 */
public class SenderThread implements Runnable {

	private IJmsSender sender;

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Runnable#run()
	 */
	@Override
	public void run() {

		LogModelStub log = new LogModelStub();
		log.setThreadFlag(Thread.currentThread().getName());

		try {
			sender.send(log);
		} catch (JMSException e) {
			e.printStackTrace();
		}
	}

	/**
	 * @param sender the sender to set
	 */
	public void setSender(IJmsSender sender) {
		this.sender = sender;
	}

}
